<?php
/**
 * Created by PhpStorm.
 * UsersF: Mloong
 * Date: 2018/12/6
 * Time: 9:35
 */

namespace app\login\controller;


use app\api\controller\v1\Token;
use app\login\model\Record;
use app\login\validate\NamePwdValidate;
use think\facade\Cookie;
use think\facade\Request;
use think\facade\Session;


class Login extends BaseController
{
    # 校验用户名和密码
    public function checkNamePwd()
    {
        (new NamePwdValidate())->goCheck();
        $token = new Token();
        $tokenScope = $token->getToken(input('post.username'));
        return json([
           'code' => 200,
            'token' => $tokenScope['token'],
        ]);
    }
}